<?php

namespace app\admin\validate;

use think\Validate;
use app\common\Error;

class Admin extends Validate
{
    protected $rule = [
        'id' => 'require',
        'rule_id' => 'require',
        'name' => 'require',
        'profile_photo' => 'require',
        'password' => 'require',
        'introduce' => 'require',
    ];

    protected $message = [
        'id.require' => Error::ID_NOT_EXIXTS,
        'rule_id.require' => Error::RULE_ID_NOT_EXIXTS,
        'name.require' => Error::NAME_NOT_EXIXTS,
        'profile_photo.require' => Error::PROFILE_PHOTO_NOT_EXIXTS,
        'password.require' => Error::PASSWORD_NOT_EXIXTS,
        'introduce.require' => Error::INTRODUCE_NOT_EXIXTS,
    ];

    protected $scene = [
        'add' => ['rule_id', 'name', 'profile_photo', 'password', 'introduce'],
        'edit' => ['id', 'rule_id', 'name', 'profile_photo', 'password', 'introduce'],
        'delete' => ['id'],
        'detail' => ['id'],
    ];
}